package com.example.Iterator;

/**
 * 迭代器模式
 * https://www.runoob.com/design-pattern/iterator-pattern.html
 */
public class app {
    public static void main(String[] args) {
        NameRepository nameRepository = new NameRepository();
        Iterator iterator = nameRepository.getIterator();
        while (iterator.hasNext()) {
            Object next = iterator.next();
            System.out.println(next);
        }
    }
}
